#include "frequency_driver.h"
#include "usart_driver.h"
#include "avr_compiler.h"
#include "communication.h"
#include "sensor.h"
#include "adc_driver.h"
#include <string.h>

void init(){
	cli();
	init_variables();
	init_uart();
	init_adc();
	init_frequency();
	PORTD.DIRSET = 0; //Port D used for pulse counting
	PORTA.DIRSET = 0; //Port A used for the adc readings
	PMIC.CTRL |= (PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm); //Enable all interrupt levels
	sei();
}
int main(void)
{

	init();
	while(1){
		receive();
	}
}



